package cn.hl.hm.dao;

import cn.hl.hm.entity.backstage.TBackstageUserEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface TBackstageUserEntityMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(TBackstageUserEntity record);

    int insertSelective(TBackstageUserEntity record);

    TBackstageUserEntity selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TBackstageUserEntity record);

    int updateByPrimaryKey(TBackstageUserEntity record);
    //查询随机人员
    TBackstageUserEntity selectByRand();
    //验证登录
    @Select("SELECT id as id,mailbox as mailbox,name as name,jurisdiction as jurisdiction,phone as phone,create_time as createTime,status as status  from t_backstage_user WHERE status = 1 and  `password` = #{password} and mailbox=#{mailbox}")
    TBackstageUserEntity selectSign(@Param("password") String password,@Param("mailbox") String mailbox);

    List<TBackstageUserEntity> selectAccountNumberList(@Param("phone") String phone,@Param("limit") Integer limit,@Param("pageSize") Integer pageSize);

    @Select("SELECT id as id,mailbox as mailbox,jurisdiction as jurisdiction from t_backstage_user WHERE id = #{id}")
    TBackstageUserEntity selectStageUser(@Param("id") Integer id);

    @Select("SELECT id as id,mailbox as mailbox from t_backstage_user WHERE mailbox = #{mailbox} limit 1")
    TBackstageUserEntity selectMailboxUser(@Param("mailbox") String mailbox);

    List<TBackstageUserEntity> selectListByIds(@Param("ids")List<Integer> ids);
}